﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Fdb.Model
{
    /// <summary>
    /// 分页查询类
    /// 范叶勇
    /// 2015-10-21 上午10时10分
    /// </summary>
    public class PagedQuery
    {
        /// <summary>
        /// 表名
        /// </summary>
        private string _TableName = "";
        /// <summary>
        /// 表名
        /// </summary>
        public string TableName
        {
            get { return _TableName; }
            set { _TableName = value; }
        }

        /// <summary>
        /// 字段ID集合
        /// </summary>
        private string _FieldIDS = "*";
        /// <summary>
        /// 字段ID集合
        /// </summary>
        public string FieldIDS
        {
            get { return _FieldIDS; }
            set { _FieldIDS = value; }
        }

        /// <summary>
        /// 连接字符串
        /// </summary>
        private string _JoinStr = "";
        /// <summary>
        /// 连接字符串
        /// </summary>
        public string JoinStr
        {
            get { return _JoinStr; }
            set { _JoinStr = value; }
        }

        /// <summary>
        /// 主键
        /// </summary>
        private string _IdField = "ID";
        /// <summary>
        /// 主键
        /// </summary>
        public string IdField
        {
            get { return _IdField; }
            set { _IdField = value; }
        }

        /// <summary>
        /// 页面索引号
        /// </summary>
        private int _PageIndex = 1;
        /// <summary>
        /// 页面索引号
        /// </summary>
        public int PageIndex
        {
            get { return _PageIndex; }
            set { _PageIndex = value; }
        }

        /// <summary>
        /// 页面尺寸
        /// </summary>
        private int _PageSize = 10;
        /// <summary>
        /// 页面尺寸
        /// </summary>
        public int PageSize
        {
            get { return _PageSize; }
            set { _PageSize = value; }
        }

        /// <summary>
        /// 条件语句
        /// </summary>
        private string _WhereClause = "";
        /// <summary>
        /// 条件语句
        /// </summary>
        public string WhereClause
        {
            get { return _WhereClause; }
            set { _WhereClause = value; }
        }

        /// <summary>
        /// 临时条件语句（用于实际SQL执行）
        /// </summary>
        private string _TMPWhereClause = string.Empty;

        /// <summary>
        /// 临时条件语句（用于实际SQL执行）
        /// </summary>
        public string TMPWhereClause
        {
            get { return _TMPWhereClause; }
            set { _TMPWhereClause = value; }
        }

        /// <summary>
        /// 排序语句
        /// </summary>
        private string _SortClause = "";
        /// <summary>
        /// 排序语句
        /// </summary>
        public string SortClause
        {
            get { return _SortClause; }
            set { _SortClause = value; }
        }

        /// <summary>
        /// 参数列表
        /// </summary>
        private NHashtable _ParamList = new NHashtable();

        /// <summary>
        /// 参数列表
        /// </summary>
        public NHashtable ParamList
        {
            get { return _ParamList; }
            set { _ParamList = value; }
        }

        /// <summary>
        /// 临时参数列表（用于实际SQL执行）
        /// </summary>
        private NHashtable _TMPParamList = new NHashtable();

        /// <summary>
        /// 临时参数列表（用于实际SQL执行）
        /// </summary>
        public NHashtable TMPParamList
        {
            get { return _TMPParamList; }
            set { _TMPParamList = value; }
        }

        /// <summary>
        /// 页面记录数
        /// </summary>
        private int _PageRecordCount = 0;

        /// <summary>
        /// 页面记录数
        /// </summary>
        public int PageRecordCount
        {
            get { return _PageRecordCount; }
            set { _PageRecordCount = value; }
        }
    }
}
